Repository navigation
fix(parser): preserve regex literals ending in an escaped slash - #740
Merged
Merged
Conversation
Cut the expected text out of the source by the parsed handler's own span instead of by handler_span. handler_span is now the whole attribute value (comment included, like Angular), while the spec expects the parsed expression. Unparsing the handler instead would pass even if every event span were wrong. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
find_interpolation_end had three rules Angular's _getInterpolationEndIndex
does not: `//` was a comment only after an even number of backslashes, a
`//` comment ended at a newline, and `/* */` hid `}}`. When no end was
found the whole `{{ ... }}` became static text, e.g.
`{{ s.replace(/\//g, '').replace(/'/g, '') }}` and
`{{ s.replace(/[/*]/g, '') }}`. Port Angular's loop
(_getInterpolationEndIndex + _forEachUnquotedChar) directly.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Port Angular's two spec cases (a regex ending in an escaped slash, escaped quotes before a comment), add a find_comment_start table, and check that handler_span keeps the trailing comment on on-, [()], bindon- and legacy animation events, as Angular's handlerSpan does. Update the find_comment_start doc. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Member
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Brooooooklyn
enabled auto-merge (squash)
November 25, 2026 15:01
Brooooooklyn
disabled auto-merge
November 25, 2026 15:01
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Supersedes #738 by @nagahara-naoki. Their commit is kept as is, with their authorship, and 3 polish commits go on top. The fork does not allow maintainer edits, so this is a new PR.
The bug
Angular's
_commentStartskips the character after a backslash, so the//in/^\//is not a comment. We cut the expression there and failed withUnterminated regular expression. The same thing broke escaped quotes before a comment ('it\'s' // c), in every kind of binding.Commits
find_comment_startskips escaped chars like Angular. Eventhandler_spanis the whole value span, as in Angular. The assignment span no longer adds the offset twice.{{ }}had the same problem:{{ s.replace(/\//g, '').replace(/'/g, '') }}and{{ s.replace(/[/*]/g, '') }}became static text. This is a direct port of_getInterpolationEndIndex+_forEachUnquotedChar.find_comment_starttable, and handler spans foron-,[()],bindon-and(@x.done).Checks
Mutation check for the runner: shifting every event span by 1 fails 6 ast_spans cases now. With the runner from #738 it still passed 55/55.
Not in this PR (older, separate)
*ngFor="…") strips//comments, but Angular doesn't.{{ // c }}gives no error, but Angular reports one.AbsoluteSourceSpannumbers and gets 0 assertions from theparseInterpolationspecs.🤖 Generated with Claude Code